<template>
    <div>
        <van-nav-bar title="分类" fixed />
        <div style="height: 45px;"></div>
        <!-- <div v-for="item in wgq"> -->
        <van-skeleton title :row="3" />
        <van-row>
            <van-col span="6">
                <van-sidebar v-model="active">
                    <van-sidebar-item v-for="item in wgq" :title="item.cat_name" />
                </van-sidebar>
            </van-col>
            <van-col span="18">
                <div v-for="item in wgq[active]?.children">
                    <router-link :to="'/lb/' + item.cat_name">
                        <h4>{{ item.cat_name }}</h4>
                        <van-grid :column-num="4">
                            <van-grid-item v-for="items in item.children" :key="value" :icon="items.cat_icon"
                                :text="items.cat_name" />
                        </van-grid>
                    </router-link>
                </div>
            </van-col>
        </van-row>
        <!-- </div> -->

    </div>
</template>

<script setup>
const active = ref(0);
import { categoriesApi } from '@/api/api'
import { ref } from 'vue'
let wgq = ref([])
categoriesApi().then(res => {
    console.log('分类', res)
    wgq.value = res.data.message
})
</script>

<style lang="scss" scoped></style>